import request from '@/utils/request'

// 查询问卷题目列表
export function listLpQuestionnaireQuestion(query) {
  return request({
    url: '/questionnaireQuestion/lpQuestionnaireQuestion/list',
    method: 'get',
    params: query
  })
}

// 查询问卷题目详细
export function getLpQuestionnaireQuestion(id) {
  return request({
    url: '/questionnaireQuestion/lpQuestionnaireQuestion/' + id,
    method: 'get'
  })
}

// 保存问卷题目
export function saveLpQuestionnaireQuestion(data) {
  return request({
    url: '/questionnaireQuestion/lpQuestionnaireQuestion/save',
    method: 'post',
    data: data
  })
}

// 删除问卷题目
export function delLpQuestionnaireQuestion(id) {
  return request({
    url: '/questionnaireQuestion/lpQuestionnaireQuestion/' + id,
    method: 'delete'
  })
}

// 导出问卷题目
export function exportLpQuestionnaireQuestion(query) {
  return request({
    url: '/questionnaireQuestion/lpQuestionnaireQuestion/export',
    method: 'get',
    params: query
  })
}

// 删除题目答案
export function delLpQuestionAnswerKey(id) {
  return request({
    url: '/questionnaireQuestion/lpQuestionnaireQuestion/deleteAnswerKey/' + id,
    method: 'delete'
  })
}

export function getLpBaseByType(type) {
  return request({
    url: '/questionnaireQuestion/lpQuestionnaireQuestion/getLpBaseByType/' + type,
    method: 'get'
  })
}

// 获取所有的问题及答案列
export function findListByQuestionnaireId(id) {
  return request({
    url: '/questionnaireQuestion/lpQuestionnaireQuestion/findListByQuestionnaireId/' + id,
    method: 'get'
  })
}
